#pragma  once
#include "stdafx.h"
#include "Flocking.h"
#include "Configuration.h"
class BehaviorAnalysis
{
public:

	double* diffusionDistance;

	double* orderParameter;

	unsigned int* color;
	
	int bufferSize;

	bool diffusionDistanceEnabled;
	
	bool fileheadEnabled;

	int nStep;
	
	bool orderParameterEnabled;

	bool positionVelocityEnabled;

public:

	BehaviorAnalysis();

	BehaviorAnalysis( Configuration& );

	~BehaviorAnalysis();

	void analyze(const Flock*);

	double getDiffusionDistance(const Flock*);

	string getFileName( string );
	
	double getOrderParameter( const Flock* );
	
	bool init( const Flock*);

	bool openDiffusionDistance( const Flock*);

	bool openOrderParameter( const Flock* );

	void reallocateSpace(int );

	void recordDiffusionDistance(const Flock*);

	void recordOrderParameter( const Flock* );

	void setConfiguration(Configuration&);

	double spinWaveApproximationQuality( const Flock* );

	void writeFileHead(Configuration&);

	void writeToFile(const Flock*, string);

	bool writeToFile_DiffusionDistance( );

	bool writeToFile_OrderParameter( );

	void writeToFile_PositionVelocity( const Flock* );

};